<div class="bjui-pageHeader">
    <div class="pull-right">
        <a href="{:U('Order/printorder',array('id'=>$order['id']))}" target="_blank" class="btn btn-default">打印</a>
    </div>
    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active"><a href="#order_basic" role="tab" data-toggle="tab" >基本信息</a></li>
        <li role="presentation"><a href="#order_take" role="tab" data-toggle="tab">收货信息</a></li>
        <li role="presentation"><a href="#order_product" role="tab" data-toggle="tab">商品信息</a></li>
        <li role="presentation"><a href="#order_freight" role="tab" data-toggle="tab">发货日志</a></li>
        <li role="presentation"><a href="#order_menoy" role="tab" data-toggle="tab">费用信息</a></li>
        <li role="presentation"><a href="#order_handle" role="tab" data-toggle="tab">操作</a></li>
        <li role="presentation"><a href="#order_log" role="tab" data-toggle="tab">操作记录</a></li>
    </ul>
</div>
<div class="bjui-pageContent">
    <div class="tab-content">
        <div id="order_basic" role="tabpanel" class="tab-pane active in">
            <table class="table table-bordered table-hover" data-selected-multi="false">
                <tbody>
                <tr>
                    <td>订单号</td>
                    <td>{$order.order_no}</td>
                </tr>
                <tr>
                    <td>会员</td>
                    <td>{$user.mobile}{$user.name}</td>
                </tr>
                <!-- <tr>
                    <td>邮箱</td>
                    <td>34754319@qq.com</td>
                </tr> -->
                <tr>
                    <td>电话</td>
                    <td>{$user.mobile}</td>
                </tr>
                <tr>
                    <td>应付</td>
                    <td>{$order.order_amount}</td>
                </tr>
                <tr>
                    <td>订单状态</td>
                    <td>{:order_status($order['order_status'])}</td>
                </tr>
                <tr>
                    <td>下单时间</td>
                    <td>{$order.create_time}</td>
                </tr>
                <if condition="$order.pay_time neq null">
                <tr>
                    <td>支付时间</td>
                    <td>{$order.pay_time}</td>
                </tr>
                </if>
                <tr>
                    <td>支付方式</td>
                    <td>{:order_pay_status($order['pay_type'])}</td>
                </tr>
                <tr>
                    <td>发票信息</td>
                    <td>{$order.invoice_type} <if condition="$order.invoice_type neq '不需要发票'">{$order.invoice_title}</if></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div id="order_take" role="tabpanel" class="tab-pane">
            <table class="table table-bordered table-hover" data-selected-multi="false">
                <tbody>
                <tr>
                    <td>收货人</td>
                    <td>{$order.accept_name}</td>
                </tr>
                <tr>
                    <td>联系方式</td>
                    <td>{$order.mobile}</td>
                </tr>
                <tr>
                    <td>地址</td>
                    <td>{:area_name($order['province'])}{:area_name($order['city'])}{:area_name($order['area'])}{:area_name($order['towns'])}{$order.address}</td>
                </tr>
                </tbody>
            </table>
        </div>
        <div id="order_product" role="tabpanel" class="tab-pane">
            <table class="table table-bordered table-hover" data-selected-multi="false">
                <thead>
                <tr>
                    <th>商品</th>
                    <th>规格</th>
                    <th>数量</th>
                    <th>单价</th>
                    <th>小计</th>
                </tr>
                </thead>
                <tbody>
                <volist name="ordergoods" id="oo">
                <tr>
                    <td><a href="{$oo['product_img']?$oo['product_img']:$oo['img']}" target="_blank">{$oo.name}</a></td>
                    <td>{:spec_detail($oo['goods_id'],$oo['spec_array'])}</td>
                    <td>{$oo.goods_nums}</td>
                    <td>{$oo.goods_price}</td>
                    <td>{$oo['goods_nums']*$oo['goods_price']}</td>
                </tr>
                </volist>
                <tr>
                    <td colspan="4" align="right">合计:</td>
                    <td>{$order.payable_amount}</td>
                </tr>
                </tbody>
            </table>
        </div>
        <div id="order_freight" role="tabpanel" class="tab-pane">
        <table class="table table-bordered table-hover table-striped " data-selected-multi="false">
            <thead>
            <tr>
                <th>操作者</th>
                <th>发货时间</th>
                <th>发货单号</th>
                <th>物流公司</th>
                <th>备注</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <volist name="freightlist" id="fo">
            <tr>
                <td>{$fo.username}</td>
                <td>{$fo.time}</td>
                <td>{$fo.delivery_code}</td>
                <td>{$fo.name}</td>
                <td>{$fo.note}</td>
                <td><a href="http://www.kuaidi100.com/" target="_blank">查看物流</a></td>
            </tr>
            </volist>
            </tbody>
        </table>
        </div>
        <div id="order_menoy" role="tabpanel" class="tab-pane">
            <table class="table table-bordered table-hover" data-selected-multi="false">
                <tr>
                    <td>小计</td>
                    <td>{$order.payable_amount}</td>
                </tr>
                <tr>
                    <td>运费</td>
                    <td>+{$order.real_freight}</td>
                </tr>
                <tr>
                    <td>积分</td>
                    <td>+{$order.exp}</td>
                </tr>
              <!--   <tr>
                    <td>余额抵扣</td>
                    <td>-0.00</td>
                </tr> -->
                <tr>
                    <td>商品优惠金额</td>
                    <td>-{$order.promotions}</td>
                </tr>
                <tr>
                    <td>订单优惠金额</td>
                    <td>-{$order.discount}</td>
                </tr>
                <!-- <tr>
                    <td>价格调整</td>
                    <td>-0.00</td>
                </tr> -->
                <tr>
                    <td>应付</td>
                    <td><span class="text-danger"><b>{$order.order_amount}</b></span></td>
                </tr>
            </table>
        </div>
        <div id="order_handle" role="tabpanel" class="tab-pane">
            <form action="{:U('update_order')}" data-callback="dialogFormCall" data-toggle="validate" data-alertmsg="false" class="dialogForm">
                <input type="hidden"  name="id" value="{$order.id}"/>
                <input type="hidden"  name="order_no" value="{$order.order_no}"/>
                <input type="hidden" id="order_status" name="order_status" value="{$order['order_status']+1}"/>
                <div class="form-group">
                    <label class="x100">操作备注:</label>
                    <textarea name="note" class="w400">{$order.note}</textarea>
                </div>
                <div class="form-group button-s">
                    <label class="x100">可执行操作:</label>
                    <eq name="order['order_status']" value="0">
                    <button type="button" class="btn-green status" data-value="1">代付款</button>
                    </eq>
                    <eq name="order['order_status']" value="1">
                    <button type="button" class="btn-green status" data-value="0">设为未付款</button>
                    </eq>
                    <eq name="order['order_status']" value="3">
                    <button type="button" class="btn-green status" data-value="4">确认收货</button>
                    </eq>
                </div>
            </form>
        </div>
        <div id="order_log" role="tabpanel" class="tab-pane">
            <table class="table table-bordered table-hover" data-selected-multi="false">
                <thead>
                <tr>
                    <th>操作人</th>
                    <th>操作时间</th>
                    <th>动作</th>
                    <th>状态</th>
                    <th>备注</th>
                </tr>
                </thead>
                <tbody>
                <volist name="orderlog" id="ol">
                <tr>
                    <td>{$ol.user}</td>
                    <td>{$ol.addtime}</td>
                    <td>{$ol.action}</td>
                    <td>{$ol.result}</td>
                    <td>{$ol.note}</td>
                </tr>
                </volist>
                </tbody>
            </table>
        </div>
    </div>
</div>
<include file="Common/footer" ftype="save" />